
package com.jf.cloud.product.listener;

import com.jf.cloud.common.product.vo.StockBillLogVO;
import com.jf.cloud.common.rocketmq.config.RocketMqConstant;
import com.jf.cloud.product.service.StockBillLogService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 入库操作监听
 * @author zz
 */
@Component
@RocketMQMessageListener(topic = RocketMqConstant.STOCK_BILL_LOG_TOPIC,consumerGroup = RocketMqConstant.STOCK_BILL_LOG_TOPIC)
public class StockBillLogConsumer implements RocketMQListener<StockBillLogVO> {

    @Autowired
    private StockBillLogService stockBillLogService;

    /**
     * 入库操作
     */
    @Override
    public void onMessage(StockBillLogVO message) {
        stockBillLogService.saveInfo(message);
    }
}
